package com.dk.feign;

import com.dk.data.Result;
import com.dk.domain.TCarDTO;
import com.dk.feign.fallback.CarSeekFeignFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

@FeignClient(value = "dongdongershouche-search-service",fallback = CarSeekFeignFallback.class)
public interface CarSeekFeign {

    //按车名查询并分页
    @RequestMapping(value = "/tCarController/getInfoByName",method = RequestMethod.POST)
    Result<List<TCarDTO>> getInfoByName(@RequestParam String name, @RequestParam("startIndex") Integer startIndex, @RequestParam("pageSize") Integer pageSize);

    //按车的标签查询
    @GetMapping("/tCarController/sele")
    Result<List<TCarDTO>> getInfoByTitle(@RequestParam String label);

    //按车的上架时间升序查询
    @GetMapping("/tCarController/getInfoByTime")
    Result<List<TCarDTO>> getInfoByTime(@RequestParam("startIndex") Integer startIndex, @RequestParam("pageSize") Integer pageSize);

}
